﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Db8.Data
{
    [Table("Roles")]
    public class Role
    {
        [Key]
        public int RoleId { get; set; }

        [Required]
        [StringLength(45, ErrorMessage = "Role name must be 45 characters or fewer")]
        [RegularExpression("[^,]+", ErrorMessage = "Role name cannot contain commas")]
        public string Name { get; set; }

        public virtual ICollection<UserRole> RoleUsers { get; set; }

    }
}
